{% extends "base.html" %}

{% block greeting %}
    <h4>{{ user|capfirst }}, welcome to the admin page</h4>
{% endblock greeting%}

{% block table %}
  <table border="1">
    <caption><em>Position Stats</em></caption>
    <tr>
      <th>{{ stats.print_column_names }}</th>
    </tr>
    <tr>
      <td>{{ stats.print_row }}</td>
    </tr>
  </table>
  <br/>
  {% for athlete in athletes %}
    {% if forloop.first %}
      <table border="1">
        <caption><em>List of Athletes</em></caption>
        <tr>
          <th>{{ athlete.print_column_names }}</th>
        </tr>
    {% endif %}
    <tr>
      <td>{{ athlete.print_row }}</td>
    </tr>
    {% if forloop.last %}
      </table>
    {% endif %}
  {% endfor %}
  <h5>{{ athletes|length }} athlete{{ athletes|length|pluralize }} in the table</h5>
{% endblock table %}